Data extraction
using SQL Server

In this project I use SQL Server to extract necessary data from Human Resource Database - which is a relational database

Database Description

The data consists of 7 tables:

  • JOB_HISTORY: includes information of employees who do not work in company any more.
    • EMPLOYEES_ID: employee identifier, unique for each employee.
    • START_DATE: the date that employee started working.
    • END_DATE:the date that employee stopped working.
    • JOB_ID: job identifier unique for each job.
    • DEPARTMENT_ID: department identifier, unique for each department.
  • JOBS: includes information of jobs.
    • JOB_ID: job identifier unique for each job.
    • JOB_TITLE: name of jobs.
    • MIN_SALARY: smallest salary of that job.
    • MAX_SALARY: largest salary of that job.
  • EMPLOYEES: includes information of employees in company.
    • EMPLOYEES_ID: employee identifier, unique for each employee.
    • LAST_NAME: last name of employees.
    • FIRST_NAME: first name of employees.
    • EMAIL: email of employees.
    • PHONE_NUMBER: phone number of employees.
    • HIRE_DATE: the date that employeee were hired.
    • JOB_ID: job identifier unique for each job.
    • SALARY: salary of employees.
    • COMMISSION_PCT: the percentage of commission.
    • MANAGER_ID: manager identifier of employees.
    • DEPARTMENT_ID: department identifier, unique for each department.
  • REGIONS: includes information of regions.
    • REGION_ID: region identifier, unique for each region.
    • REGION_NAME: the name of region name.
  • COUNTRIES: includes information of countries.
    • COUNTRY_ID: country identifier, unique for each country.
    • COUNTRY_NAME: the name of country
    • REGION_ID: region identifier, unique for each region.
  • LOCATION: includes information of locations.
    • LOCATION_ID: location identifier, unique for each location.
    • STREET_ADDRESS: the address of the location.
    • POSTAL_CODE:
    • CITY: city of location.
    • STATE_PROVINCE:
    • COUNTRY_ID: country identifier, unique for each country.
  • DEPARTMENT: includes information of all departments in company.
    • DEPARTMENT_ID: department identifier, unique for each department.
    • DEPARTMENT_NAME: the name of departments.
    • MANAGER_ID: manager identifier of employees.
    • LOCATION_ID: location identifier, unique for each location.

Here the full code that I use to extract data.

Click here